home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1996 January / macformat-033.iso / mac / Shareware City / Developers / ABox.v1.8 / Header Files / ABSound.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-23  |  3.6 KB  |  129 lines  |  [TEXT/MMCC]

  1. /*    
  2.     Copyright © 1991-1995 by TopSoft Inc.  All rights reserved.
  3.  
  4.     You may distribute this file under the terms of the TopSoft
  5.     Artistic License, accompanying this package.
  6.     
  7.     This file was developed by George (ty) Tempel in connection with TopSoft, Inc..
  8.     See the Modification History for more details.
  9.  
  10. Product
  11.     About Box
  12.  
  13. FILE
  14.     ABSound.h
  15.  
  16. NAME
  17.     ABSound.h, part of the ABox project source code,
  18.     responsible for handling the AboutBox Sound class stuff.
  19.  
  20. DESCRIPTION
  21.     This file contains defines for the about box modules.
  22.     
  23. DEVELOPED BY
  24.     George (ty) Tempel                netromancr@aol.com
  25.     All code in this file, and its associated header file was
  26.     Created by George (ty) Tempel in connection with the TopSoft, Inc.
  27.     "FilterTop" application development, except where noted.
  28.  
  29. CARETAKER - George (ty) Tempel <netromancr@aol.com>
  30.      Please consult this person for any changes or suggestions to this file.
  31.  
  32. MODIFICATION HISTORY
  33.  
  34.     dd mmm yy    -    xxx    -    patchxx: description of patch
  35.     9 June 94    -    ty    -    Initial Version Created
  36.     20-july-94    -    ty    -    initial version released
  37.     23-may-95    -    ty    -    changes for compatibility with the CodeWarrior CW6
  38.                             release and the associated Universal Headers from Apple:
  39.                             most methods that returned references now have "Ref" at
  40.                             the end of their methods names to prevent possible collisions
  41.                             with datatypes and classes of the same name (older versions
  42.                             of the compiler didn't have a problem with this).
  43.  
  44. */
  45.  
  46. /*===========================================================================*/
  47.  
  48. /*========== Exclusion Macros ============*/
  49.  
  50. #pragma    once
  51.  
  52. #ifndef    _ABSound_
  53. #define    _ABSound_
  54.  
  55.  
  56. /*============ Header Files ==============*/
  57.  
  58. #include    "ABResource.h"
  59.  
  60.  
  61. /*=========== External Linkage ===========*/
  62.  
  63. /*================ Macros ================*/
  64.  
  65. /*============== Constants ===============*/
  66.  
  67. #define        kABSoundResource                ((ResType)'snd ')
  68.  
  69. #define        kABnoSoundParam1                ((short)0)
  70. #define        kABnoSoundParam2                ((long)0)
  71. #define        kABsoundDelayHalfMilliseconds    ((short)20)
  72.  
  73. #define        kABSoundSignature                'ABox'
  74.  
  75. /*================ Enums =================*/
  76.  
  77. /*=============== Structs ================*/
  78.  
  79. /*=============== Typedefs ===============*/
  80.  
  81. /*=========== Class Definitions ==========*/
  82.  
  83. #define    kABSoundSuperProperties    ABResource
  84. class    ABSound : public ABResource
  85. {
  86.     public:
  87.                         ABSound(void);
  88.         virtual            ~ABSound(void);
  89.  
  90.         virtual    OSErr    Draw(WindowPtr window);
  91.         virtual    OSErr    Update(WindowPtr window);
  92.  
  93.         virtual    OSErr    Stop(void);
  94.         
  95.                 Boolean    IsSoundChannelDone(void) const    { return this->SoundChannelDone() == true; }
  96.                 Boolean IsSoundChannelBusy(void) const    { return ! this->IsSoundChannelDone(); }
  97.                 
  98.                 Boolean HasSoundChannelPointer(void) const    { return this->SoundChannelPointer() != NULL; }
  99.                 Boolean DoesntHaveSoundChannelPointer(void) const { return !this->HasSoundChannelPointer(); }
  100.                 
  101.                 Boolean HasSoundCallback(void) const    { return this->SoundCallback() != NULL; }
  102.                 Boolean DoesntHaveSoundCallback(void) const { return ! this->HasSoundCallback(); }
  103.                 
  104.     protected:
  105.  
  106.         static    pascal void    DoSnd_done (SndChannelPtr channel, SndCommand *command);
  107.  
  108.     private:
  109.                 Boolean            mSoundChannelDone;    //    used to indicate the channel should close down
  110.                 SndChannelPtr    mSoundChannelPtr;    //    the sound channel per-se
  111.                 SndCallBackUPP    mSoundCallbackUPP;    //    used for callbacks
  112.  
  113.                 Boolean&        SoundChannelDone(void) const    { return this->mSoundChannelDone; }
  114.                 SndChannelPtr&    SoundChannelPointer(void) const    { return this->mSoundChannelPtr; }
  115.                 SndCallBackUPP&    SoundCallback(void) const        { return this->mSoundCallbackUPP; }
  116.                 
  117.         static    short            sCounter;
  118.                 short            mSoundSignature;
  119. };
  120.  
  121.  
  122.  
  123.  
  124. /*========== Function Prototypes =========*/
  125.  
  126.  
  127. #endif    // _ABSound_
  128.  
  129.